public class Test {
    public static void main(String[] args) {
        MyBinaryTree myBinaryTree = new MyBinaryTree();
        MyBinaryTree.BTNode root = myBinaryTree.creatTree();
        //先序遍历：ABDEHCFG
        myBinaryTree.preOrder(root);
        System.out.println();
        //中序遍历：DBEHAFCG
        myBinaryTree.inOrder(root);
        System.out.println();
        //后续遍历：DHEBFGCA
        myBinaryTree.postOrder(root);
        System.out.println();

        //层序遍历：ABCDEFGH
        myBinaryTree.levelOrder(root);
        System.out.println();

        //结点个数：
        System.out.println(myBinaryTree.size(root));

        //获取第K层节点的个数
        System.out.println(myBinaryTree.getKLevelNodeCount(root, 4));

        //二叉树叶子的结点个数
        System.out.println(myBinaryTree.getLeafNodeCount(root));

        //二叉树的高度
        System.out.println(myBinaryTree.getHeight(root));
    }
}
